package edu.java.texbooks.scjp.threads.test04.mailbox.extra;

public class Consumer implements Runnable {

	Mailbox mailbox = null;

	public Consumer(Mailbox mailbox) {
		this.mailbox = mailbox;
	}

	@Override
	public void run() {
		while (true) {
			String printMessage = mailbox.retrieveMessage();
			System.out.println("Consumer prints: " + printMessage);
		}
	}
}
